#include "StdAfx.h"
#include "CFGConfig.h"

#ifdef WIN64
#ifdef _DEBUG
#pragma comment(lib,"../../lib/debug-64bit/XmlRWd.lib")
#else
#pragma comment(lib,"../../lib/release-64bit/XmlRW.lib")
#endif
#else
#ifdef _DEBUG
#pragma comment(lib,"../../lib/debug/XmlRWx86d.lib")
#else
#pragma comment(lib,"../../lib/release/XmlRWx86.lib")
#endif
#endif

using namespace xml_api;

CCFGConfig* CCFGConfig::m_ptr_instance = new CCFGConfig;
CCFGConfig* CCFGConfig::Instance()
{
	return m_ptr_instance;
}

CCFGConfig::CCFGConfig()
{

}

bool CCFGConfig::SaveState(Memento* m)
{
	return true;
}

bool CCFGConfig::LoadState(Memento* m)
{
	int child_num=m->GetChildCount();
	for(int i=0; i<child_num; ++i)
	{
		Memento* child_m=m->GetChild(i);
		std::string child_name = child_m->GetName();
		if("DirPath" == child_name)
		{
			m_dir_info.LoadState(child_m);
		}
	}

	return true;
}
